package com.ihr360.expr.operator;

import com.ihr360.expr.ExprException;
import com.ihr360.expr.context.IEvaluationContext;
import com.ihr360.expr.core.AbstractComparisonOperator;
import com.ihr360.expr.core.Expr;
import com.ihr360.expr.core.ExprType;

public class ExprGreaterThan extends AbstractComparisonOperator
{
    public ExprGreaterThan(Expr lhs, Expr rhs) {
        super(ExprType.GreaterThan, lhs, rhs);
    }

    public Expr evaluate(IEvaluationContext context) throws ExprException {
        return bool(compare(context) > 0);
    }

    public String toString() {
        return lhs + ">" + rhs;
    }
}